package sk.pitonak.mhd.ui;

import sk.pitonak.mhd.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;

public class HistoryItem extends LinearLayout {
	private boolean mSelected = false;
	private View mIndicator;

	public HistoryItem(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	
	public void setChecked(boolean selected) {
		if(mSelected == selected) return;
		mSelected = selected;
		
		if(mIndicator == null) mIndicator = findViewById(R.id.indicator_selected);
		
		if(selected) {
			mIndicator.setVisibility(View.VISIBLE);
		}
		else {
			mIndicator.setVisibility(View.GONE);
		}
	}
}
